//
//  UIView+Extension.swift
//  Webo
//
//  Created by 曾静 on 16/7/3.
//  Copyright © 2016年 qq. All rights reserved.
//

import UIKit
//为UIView的一个分类,提供设置frame
extension UIView {
    
    var height : CGFloat {
        
        get{
            return frame.size.height
        }
        set{
            frame.size.height = newValue
        }
    }
    var width : CGFloat {
        
        get{
            return frame.size.width
        }
        set{
            frame.size.width = newValue
        }
    }
    
    var x : CGFloat{
        get{
            return frame.origin.x
        }
        set{
            frame.origin.x = newValue
        }
    }

    var y : CGFloat{
        get{
            return frame.origin.y
        }
        set{
            frame.origin.y = newValue
        }
    }
    var size : CGSize {
        
        get{
            return frame.size
        }
        set{
            frame.size = newValue
        }
    }
    var centerX : CGFloat {
        
        get{
            return center.x
            
        }
        set{
            center.x = newValue
        }
    }
    var centerY : CGFloat {
        
        get{
            return center.y
            
        }
        set{
            center.y = newValue
        }
    }
}


